<%-- 
    Document   : temp
    Created on : Oct 11, 2013, 10:09:53 AM
    Author     : NGUYEN
--%>
<%@page import="DTO.NHANVIENDTO"%>
<%@page import="java.util.ArrayList"%>
<%@page import="DAO.NHANVIENDAO"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>DanhSachNhanVien</title>
<script language="javascript" type="text/javascript">
	function showMenu(isShow,idSubMenu)
	{
		var subMenu = document.getElementById(idSubMenu);
		if(isShow==true)
			subMenu.style.visibility = "visible"
		else
			subMenu.style.visibility = "hidden"
	}
</script>
<style type="text/css">
	.menu
	{
		position:absolute;
		visibility:hidden;
	}
	
	
</style>
</head>


<body>
<table width="800" border="1" align="center">
<!--header-->
<jsp:include page="header.jsp"/>
  <!--header end-->
  
  <!--menu-->
  <jsp:include page="menu.jsp"/>
    <!--menu end-->
    
    <!--body-->
    <tr>
  	
    <td height="404" align="center" valign="top"><p><b>DANH SÁCH NHÂN VIÊN  </b></p>
    <form id="form1" name="form1" method="post" action="timkiemnhanvien">
        <label>
          <input name="btTimSP" type="submit" id="btTimSP" value="Tìm Kiếm" />
        </label>
        <p>
          <label>
          <select name="select">
              <option value="1">Tìm Theo Mã</option>
              <option value="2">Tìm Theo Tên</option>
              <option value="3">Tìm Theo Loại</option>
          </select>
          </label>
          <label>
          <input name="tfTimSP" type="text" id="tfTimSP" />
          </label>
        </p>
      </form>
        <table width="90%" border="1" align="center">
        <tr>
          <td width="6%" align="center" bgcolor="#99CC00">Mã NV</td>
          <td width="17%" align="center" bgcolor="#99CC00">Pass </td>
          <td width="21%" align="center" bgcolor="#99CC00">Tên Nhân Viên </td>
          <td width="6%" align="center" bgcolor="#99CC00">Loại NV </td>
          <td width="20%" align="center" bgcolor="#99CC00">Địa chỉ </td>
          <td width="12%" align="center" bgcolor="#99CC00">Phone </td>
          <td width="30%" align="center" bgcolor="#99CC00">Chọn</td>
        </tr>
            
        <!--Bat dau vong lap for(i=0;i<so dong;i++):de cho ra so dong cua Table-->
        <%
                   ArrayList<NHANVIENDTO> ds = new ArrayList<NHANVIENDTO>();
                   ds = (ArrayList<NHANVIENDTO>)request.getAttribute("danhsach");
                   if (ds.isEmpty()) {
        %>
        <tr>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
          
          <%                } else {
                            for (int i = 0; i < ds.size(); i++) {
                                int manv = ds.get(i).getManv();
                                String password = ds.get(i).getPassword();
                                String tennv = ds.get(i).getTennv();
                                int maloainv = ds.get(i).getMaloainv();
                                String diachi = ds.get(i).getDiachi();
                                String phone = ds.get(i).getPhone();
                        %>
        </tr>
        <tr>
            <td><a href="laynhanviencoma?ma=<%=manv%>"><%=manv%></td>
            <td><%=password%></td>
            <td><%=tennv%></td>
            <td><%=maloainv%></td>
            <td><%=diachi%></td>
            <td><%=phone%></td>
            <td align="center">
                <form id="form2" name="form2" method="post" action="">
                     <label>
                           <input name="btDelete" type="submit" id="btDelete" value="Xóa" style="width:50px"/>
                     </label>
                     <label>
                           <input name="btUpdate" type="submit" id="btUpdate" value="Sửa" style="width:50px"/>
                     </label>
                </form>
                            </td>
        </tr>
          <%
                                }

                            }
                        %>
        <!--Ket thuc vong lap for()-->
        
        
      </table> 
        <form id="form3" name="form3" method="post" action="themnhanvien.jsp">
        <label>
          <input name="btThemSP" type="submit" id="btThemSP" value="Thêm" style="width:70px"/>
        </label>
      </form>      <p>&nbsp; </p></td>
  </tr>
  <!--body end-->
  <!--footer-->
  <jsp:include page="footer.jsp"/>
  <!--footer end-->
</table>
</body>
</html>


